package com.ay277.htqoa.event.controller;

import com.ay277.htqoa.event.biz.EventBiz;
import com.ay277.htqoa.event.entity.Event;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by Administrator on 2016/12/19.
 */
@Controller
@RequestMapping("/event")
public class EventController {
    @Autowired
    private EventBiz eventBiz;

    public EventBiz getEventBiz() {
        return eventBiz;
    }

    public void setEventBiz(EventBiz eventBiz) {
        this.eventBiz = eventBiz;
    }

    @RequestMapping("/save")
    @ResponseBody

    public Object save(Event event,String result){
        eventBiz.doSave(event);
        return event;
    }
    @RequestMapping("/list")
    @ResponseBody
    public List<Event> list(String start,String end){
        List<Event> list=eventBiz.findEvent(start,end);
        return list;
    }
}
